home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-15 | 5.6 KB | 225 lines | [TEXT/MPS ] |
- //
- // MySimpleCompare.r
- //
- // All files from this example are installed to folder "Simple Compare Example"
- // on the root of the selected target volume of the installation.
- //
- // This script demonstrates installing two test files, one based on creation
- // date comparison, the other based on version comparison against target file.
- // Date for source file, to be compared against target file, is specified in
- // the source file spec ('infs' ). The version number for source file, to be
- // compared against target file, is specified in the file atom ( 'infa' ).
- //
- // To compare files by date specify 'useSrcCrDateToCompare' within file atom
- // ( 'infa' ), and to compare files by version specify 'useVersProcToCompare'.
- //
- // See the "File Compare by Procedure" example for instructions on how
- // to implement custom version comparison with the Installer.
- //
- // NOTE: File versions and dates are ignored during Custom Remove.
- //
- //
- // mark young • 08/18/94
- //
- // Copyright 1993-1994, Apple Computer, Inc., All Rights Reserved
- //
-
- #include "InstallerTypes.r"
-
- // • packages
-
- // do a compare before installing based on the Creation date of
- // target file against the date specified in the 'infs' resource
- resource 'inpk' (100) {
- format0 {
- showsOnCustom,
- removable,
- dontForceRestart,
- 0,
- 0,
- "TeachText to “Simple Compare Example” folder ( by creation date )",
- {
- 'infa', 1000
- },
- }
- };
-
- // do a compare before installing based on the 'vers' (1) resource
- // of target against 'vers' value specified in 'infs' resource
- resource 'inpk' (200) {
- format0 {
- showsOnCustom,
- removable,
- dontForceRestart,
- 0,
- 0,
- "TeachText to “Simple Compare Example” folder ( by version )",
- {
- 'infa', 2000
- },
- }
- };
-
-
- // • file atoms
-
- // creation date compare file atom ( date set in 'infs' )
- resource 'infa' (1000) {
- format1 {
- deleteWhenRemoving,
- deleteWhenInstalling,
- copy,
- dontIgnoreLockedFile,
- dontSetFileLocked,
- useSrcCrDateToCompare, // • Use creation date for compare
- srcNeedExist,
- rsrcForkInRsrcFork,
-
- leaveAloneIfNewer, // if target file is newer:
- // Easy Install - skip installing file
- // Custom Install - ask "newer,older,cancel"
-
- updateExisting, // Update an existing file
- copyIfNewOrUpdate,
- rsrcFork,
- dataFork,
- 0, // TARGET - size ( filled in by ScriptCheck )
- 0x0, // Finder Attribute flags ( filled in by ScriptCheck )
- 10000, // TARGET - file spec ( 'intf' )
- {
- 10000, // SOURCE - file spec ( 'infs' )
- 0,
- 0
- },
-
- 0x0, // • version number
- // ( not used with 'useSrcCrDateToCompare' )
-
- 0, // 'invc' code resource - not used
- 0, // 'inex' code resource - not used
- ""
- }
- };
-
- // simple version compare ( 'vers' (1) ) file atom
- resource 'infa' (2000) {
- format1 {
- deleteWhenRemoving,
- deleteWhenInstalling,
- copy,
-
- dontIgnoreLockedFile,
- dontSetFileLocked,
-
- useVersProcToCompare, // • use version resource for comparison
- // - defaults to std version compare
- // if no 'invc' code resource specifed below
-
- srcNeedNotExist,
- rsrcForkInRsrcFork,
- leaveAloneIfNewer, // • if target file is newer:
- // Easy Install - skip installing file
- // Custom Install - ask "newer,older,cancel"
-
- updateExisting,
- copyIfNewOrUpdate,
-
- rsrcFork,
- dataFork,
-
- 0, // TARGET - size ( 0 filled in by ScriptCheck )
- 0x0, // Finder Attribute flags ( 0x0 filled in by ScriptCheck )
- 20000, // TARGET - file spec ( 'infs' )
- {
- 20000, // SOURCE - file spec ( 'infs' )
- 0,
- 0
- },
-
- 0x0, // • version number for comparisons
- // NOTE: this value is filled in by ScriptCheck
- // when value is set to 0x0 and
- // 'useVersProcToCompare' flag is specified
-
- 0, // 'invc' code resource - none used
- // • be sure this is set to zero to force
- // the Installer to use its default
- // version comparison method
-
- 0, // 'inex' code resource - none used
- "" // file atom description
- }
- };
-
-
- // • creation date comparison file specs
-
- // target file spec
- resource 'intf' (10000) {
- format1 {
- noSearchForFile, // use default search path
- TypeCrNeedNotMatch, // target TYPE,CREATOR need not match
- 'APPL', // target TYPE ( ignored, see above )
- 'ttxt', // target CREATOR ( ignored, see above )
- 0, // finder attribute flags
-
- 0x1, // creation date for new file or to compare
- // with creation date of existing file.
-
- 0x1, // modification date for new file
- // ( filled by ScriptCheck if set to 1 )
- // - this is only used when creating
- // a new file, they are not used for
- // comparisons.
-
- 0, // search proc ID ( 'insp' )
-
- ":Simple Compare Example:TeachText • comp by date"
- // path to target file
- }
- };
-
- // source file spec
- resource 'infs' (10000) {
- 'APPL',
- 'ttxt',
- 0x1,
- noSearchForFile,
- TypeCrMustMatch,
- "Disk 1:TeachText • comp by date"
- };
-
-
-
- // • version comparison file specs
-
- // target file spec
- resource 'intf' (20000) {
- format1 {
- noSearchForFile,
- TypeCrNeedNotMatch,
- 'APPL',
- 'ttxt',
- 0,
- 0x1, // creation date for new file
- 0x1, // modification date for new file
- // ( value of 1 filled by ScriptCheck )
- // - these are only used when creating
- // a new file
- 0,
- ":Simple Compare Example:TeachText • comp by vers"
- // path to target file
- }
- };
-
- // source file spec
- resource 'infs' (20000) {
- 'APPL',
- 'ttxt',
- 0x1,
- noSearchForFile,
- TypeCrMustMatch,
- "Disk 1:TeachText • comp by vers"
- };
-
-